<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width">
		<title>JS Bin</title>
		<style type="text/css">
			@keyframes rotating {
				0% {
					transform: rotateZ(0deg);
				}
				100% {
					transform: rotateZ(360deg);
				}
			}
			.box {
				width: 100px;
				height: 100px;
				background: #00ff00;
				animation: rotating infinite 2s;
			}

		</style>
	</head>
	<body>
		<input type="text" id="input1">
		<input type="text" id="input2">

		<div class="box"></div>
	</body>
	<script type="text/javascript">
		const input1 = document.getElementById('input1')
		const input2 = document.getElementById('input2')
		const a = {}
		var value = ''
		Object.defineProperty(a, "value", {
			configurable: true,
			set: function(newValue) {
				value = newValue
				console.log('a.b', newValue)
			},
			get: function () {
				return value
			}
		})
		input2.addEventListener('change', function() {
			const { value } = this
			input1.value1 = value
			// input1.setAttribute('value1', value)
		})
		input1.addEventListener('change', function() {
			alert(this.value)
		})
	</script>
</html>